// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "WorldEntity.h"
#include "WorldSignalParts.h"
#include "WorldRoadObjectOrientation.h"
#include "WorldLaneValidity.h"

/**
 * An entity of a signal.
 */
class FWorldSignal : public FWorldEntity
{

public:

	using Ptr = std::shared_ptr<FWorldSignal>;
	using Super = FWorldEntity;

	FWorldEntityProperty< double >											S;
	FWorldEntityProperty< double >											T;
	FWorldEntityProperty< std::string >										Name;
	FWorldEntityBoolProperty< FWorldEntityBoolYesNoRule >					Dynamic;
	FWorldEntityProperty< FWorldRoadObjectOrientation >						Orientation;
	FWorldEntityProperty< double >											ZOffset;
	FWorldEntityProperty< std::string >										Country;
	FWorldEntityProperty< std::string >										Type;
	FWorldEntityProperty< std::string >										Subtype;
	FWorldEntityProperty< double >											Value;
	FWorldEntityProperty< std::string >										Unit;
	FWorldEntityProperty< double >											Height;
	FWorldEntityProperty< double >											Width;
	FWorldEntityProperty< std::string >										Text;
	FWorldEntityProperty< double >											HOffset;
	FWorldEntityProperty< double >											Pitch;
	FWorldEntityProperty< double >											Roll;
	FWorldEntityPartArrayReference< FWorldLaneValidity, 0, INT_MAX >		Validity;
	FWorldEntityPartArrayReference< FWorldSignalDependency, 0, INT_MAX >	Dependency;

public:

	FWorldSignal();
	FWorldSignal(const json& j);
	~FWorldSignal() override;

	void Resolve(FWorldEntityReferencing& referencing) override;

	WORLD_ENTITY_META_DECLARE(FWorldSignal)

};
